﻿<%@ Page Title="" Language="C#" MasterPageFile="~/TrangChu.master" AutoEventWireup="true"
    CodeFile="Gio_Hang.aspx.cs" Inherits="Gio_Hang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%">
        <tr>
            <td>
                <div class="cnt_block1">
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td class="c_top_c">
                                &nbsp;<br />
                                &nbsp;GIỎ HÀNG<br />
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
        </tr>
        <tr>
            <td style="width: 100%">
                <asp:Label ID="khongcohang" runat="server"></asp:Label>
                <asp:Panel Width="100%" ID="panelgiohang" Visible="false" runat="server">
                    <asp:GridView ID="danhsachgiohang" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        ForeColor="#333333" GridLines="None" PageSize="5" Width="100%" 
                        onrowcancelingedit="danhsachgiohang_RowCancelingEdit" 
                        onrowdeleting="danhsachgiohang_RowDeleting" 
                        onrowediting="danhsachgiohang_RowEditing" 
                        onrowupdating="danhsachgiohang_RowUpdating">
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                        <Columns>
                            <asp:TemplateField HeaderText="TÊN HÀNG" HeaderStyle-HorizontalAlign="left">
                                <ItemTemplate>
                                    <a href="" title='<%#DataBinder.Eval(Container,"DataItem.Ten_SP") %>'>
                                        <asp:Label ID="Label2" runat="server" Text='<%# (((string)DataBinder.Eval(Container, "DataItem.Ten_SP")).Length > 30 ? ((string)DataBinder.Eval(Container, "DataItem.Ten_SP")).Substring(0, 29) + "..." : DataBinder.Eval(Container, "DataItem.Ten_SP")) %>'></asp:Label></a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="So_Luong" HeaderText="SỐ LƯỢNG">
                                <ItemStyle HorizontalAlign="Center" ForeColor="Red" />
                            </asp:BoundField>
                            <asp:BoundField HeaderStyle-HorizontalAlign="right" DataField="Don_Gia" HeaderText="ĐƠN GI&#193;"
                                DataFormatString="{0:#,##0} VNĐ" ReadOnly="True">
                                <ItemStyle ForeColor="Green" HorizontalAlign="right" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="TH&#192;NH TIỀN" HeaderStyle-HorizontalAlign="right">
                                <ItemTemplate>
                                    <div align="right">
                                        <asp:Label ID="Label1" runat="server" Text='<%# String.Format("{0:#,##0} VNĐ",float.Parse(DataBinder.Eval(Container,"DataItem.Don_Gia").ToString()) *(int) DataBinder.Eval(Container,"DataItem.So_Luong")) %>'></asp:Label></div>
                                </ItemTemplate>
                                <ItemStyle ForeColor="Red" />
                            </asp:TemplateField>
                            <asp:CommandField CancelText="<img border='0' src='Images/nut/cancel.gif'>" DeleteText="X&#243;a"
                                EditText="<img border='0' src='Images/nut/sua.jpg'>" InsertText="Th&#234;m" NewText="Mới"
                                SelectText="Chọn" ShowEditButton="True" UpdateText="<img border='0' src='Images/nut/save.gif'>" />
                            <asp:CommandField CancelText="Kh&#244;ng" DeleteText="<img border='0' src='Images/nut/xoa.jpg'>"
                                EditText="Sửa" InsertText="Th&#234;m" NewText="Mới" SelectText="Chọn" ShowDeleteButton="True"
                                UpdateText="<img border='0' src='Images/nut/Save.jpg'>" />
                        </Columns>
                        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <table width="100%">
                        <tr>
                            <td colspan="3">
                                <hr color="#008000" size="1">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <font color="#800080">Tổng Số Tiền</font> &nbsp;
                            </td>
                            <td align="right">
                                <asp:Label ID="tongtien" runat="server" Text="<font color='red'>0</font>"></asp:Label>
                            </td>
                            <td align="right" width="20%">
                                <font color='blue'>VNĐ</font>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <font color="#800080">Tổng Số Hàng Bạn Đã Chọn Mua</font> &nbsp;
                            </td>
                            <td align="right">
                                <asp:Label ID="tonghang" runat="server" Text="<font color='red'>0</font>"></asp:Label>
                            </td>
                            <td align="right" width="20%">
                                <font color='green'>Sản Phẩm</font>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <hr color="#008000" size="1">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="tieptucmua" runat="server" Text="Tiếp Tục Mua Hàng" 
                                    onclick="tieptucmua_Click" />
                            </td>
                            <td>
                                <asp:Button ID="xoagiohang" runat="server" Text="Xóa Giỏ Hàng" 
                                    onclick="xoagiohang_Click" />
                            </td>
                            <td align="right">
                                <asp:Button ID="thanhtoan" runat="server" Text="Thanh Toán" 
                                    onclick="thanhtoan_Click" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="panelthanhtoan" Visible="false" runat="server">
                    <table width="100%">
                        <tr>
                            <td>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
